# -*- coding: utf-8 -*-

import poplib
host = 'pop3.126.com'
pp = poplib.POP3(host)
pp.user('jeanhwea@126.com')
pp.pass_('123')
ret = pp.stat()
print ret
for i in range(1, ret[0]+1):
    mlist = pp.top(i, 0)
    print 'line: ', len(mlist[1])
ret = pp.list()
print ret
down = pp.retr(1)
print 'lines:', len(down)
for line in down[1]:
    print line
pp.quit()